import type { PageParam, PageResult } from '@vben/request';

import { requestClient } from '#/api/request';

export namespace ActivitySignupApi {
  /** 活动报名 */
  export interface ActivitySignup {
    id?: number;
    communityId?: number;
    merchantId?: number;
    activityId?: number;
    userId?: number;
    personId?: number;
    signupTime?: Date;
    auditStatus?: number;
    auditTime?: Date;
    auditBy?: number;
    auditRemark?: string;
    checkinStatus?: number;
    checkinTime?: Date;
    pointAwarded?: number;
    experienceAwarded?: number;
    cancelStatus?: number;
    cancelTime?: Date;
    cancelReason?: string;
    createTime?: Date;
    updateTime?: Date;
  }
}

/** 查询活动报名分页 */
export function getActivitySignupPage(params: PageParam) {
  return requestClient.get<PageResult<ActivitySignupApi.ActivitySignup>>(
    '/cmt/activity-signup/page',
    { params },
  );
}

/** 查询活动报名详情 */
export function getActivitySignup(id: number) {
  return requestClient.get<ActivitySignupApi.ActivitySignup>(
    `/cmt/activity-signup/get?id=${id}`,
  );
}

/** 新增活动报名 */
export function createActivitySignup(data: ActivitySignupApi.ActivitySignup) {
  return requestClient.post('/cmt/activity-signup/create', data);
}

/** 修改活动报名 */
export function updateActivitySignup(data: ActivitySignupApi.ActivitySignup) {
  return requestClient.put('/cmt/activity-signup/update', data);
}

/** 删除活动报名 */
export function deleteActivitySignup(id: number) {
  return requestClient.delete(`/cmt/activity-signup/delete?id=${id}`);
}

/** 批量删除活动报名 */
export function deleteActivitySignupList(ids: number[]) {
  return requestClient.delete(
    `/cmt/activity-signup/delete-list?ids=${ids.join(',')}`,
  );
}

/** 导出活动报名 */
export function exportActivitySignup(params: any) {
  return requestClient.download('/cmt/activity-signup/export-excel', { params });
}
